package com.example.administrator.exkotlin.base.`object`

/**
 * 单例 直接使用 object修饰
 * */
object DataHanlder {
    fun <T> getDataType(objects: T): DataType {
        var result = when (objects) {
            is Student -> DataType.Person
            is Person -> DataHanlder.DataType.Person
            is Animal -> DataType.Animal
            else -> DataType.noting
        }
        return result
    }

    fun study(study:IStudy){
        study.write("")
    }

    enum class DataType {
        Person, Animal, noting
    }
}